﻿using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data;
using System.Collections.Generic;
using System.Web.Configuration;
using Data;


[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]


// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]

public class AutoLoad : System.Web.Services.WebService
{
    string connectionString = BCDataCenter.Configuration.CurrentConnectionString;
   
    public AutoLoad()
    {

    }
    clsObj Obj;
    clsSql Sql = new clsSql();

    [WebMethod]
    public string[] fMaHang(string prefixText, int count)
    {
        Obj = new clsObj();
        Obj.Parameter = new string[] { "@makh" };
        Obj.ValueParameter = new object[] { prefixText };
        Obj.SpName = "sp_Search_Khachhang_Auto";
        Obj.CnnString = connectionString;
        Sql.fGetData(Obj);
        int dem = Obj.Dt.Rows.Count;
        string[] StrTen = new string[dem];
        DataTable da = new DataTable();
        for (int i = 0; i < dem; i++)
        {
            try
            {
                StrTen[i] = Obj.Dt.Rows[i]["makh"].ToString();
            }
            catch
            {
            }
        }
        return StrTen;
    }

}

